package cn.nai.DemoRan.demo08;

import java.util.ArrayList;
import java.util.Collections;

class test{
    public static void main(String[] args) {

        Student1 s1 = new Student1(20170853, "张三", 19);
        Student1 s2 = new Student1(20170974, "李四", 20);
        Student1 s3 = new Student1(20180974, "王五", 18);
        ArrayList<Student1> list = new ArrayList<Student1>();
        list.add(s1);
        list.add(s2);
        list.add(s3);
        Collections.sort(list);
        for (Student1 i:list){
            System.out.println(i);
        }
    }
}
